package config

import (
	"github.com/zeromicro/go-zero/core/logx"
	"github.com/zeromicro/go-zero/rest"
	"github.com/zeromicro/go-zero/zrpc"
)

type Config struct {
	Mysql             MysqlConfig
	SQLite            SQLiteConfig
	RestServices      map[string]ServiceConfig
	RpcService        RpcServiceConfig
	EnableRsync       bool
	WebSocketPort     int
	UseMysql          bool
	ServicesLogConfig map[string]ServicesLogConfig
	AgentConf         AgentConfig
}

type MysqlConfig struct {
	DataSource string
	Tables     struct {
		UserInfoTable          string
		AgentHeartbeats        string
		ComponentInfo          string
		DeploymentLogs         string
		DocumentationKnowledge string
		AlertRules             string
		AlertRulesInfo         string
		Notifications          string
	}
}

type SQLiteConfig struct {
	DataSource string
	Tables     struct {
		UserInfoTable          string
		AgentHeartbeats        string
		ComponentInfo          string
		DeploymentLogs         string
		DocumentationKnowledge string
	}
}

type ServiceConfig struct {
	RestConf rest.RestConf
}

type RpcServiceConfig struct {
	zrpc.RpcServerConf
}

type ServicesLogConfig struct {
	logx.LogConf
}

type AgentConfig struct {
	MemoryMax   string
	MetricsPort int32
}
